﻿<%@ Page Title="Login" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" Inherits="System.Web.Mvc.ViewPage" %>
<asp:Content ID="content" ContentPlaceHolderID="MainContent" runat="server">

	<h2>Login via OpenID</h2>

	<% if( ( TempData["ErrorMessage"] ?? ViewData["ErrorMessage"] ) != null ){ %>
	<p class="MvcMembershipError"><% =(string)TempData["ErrorMessage"] ?? (string)ViewData["ErrorMessage"]%></p>
	<% } %>

	<% using(Html.Form( "FormsAuthentication", "OpenIDAuthenticate" )){ %>
	<fieldset class="MvcMembership">
		<legend>Login</legend>
		<div><label for="identity">OpenID Url:</label> <% =Html.TextBox( "identity" )%></div>
		<div><% =Html.SubmitButton( "submit", "Login", new { onclick = "return starterKit_mvc_membership_validateOpenIdLogin();" } )%></div>
	</fieldset>
	<% } %>

	<script type="text/javascript">
	/* <![CDATA[ */

		function starterKit_mvc_membership_validateOpenIdLogin()
		{

			var identity = document.getElementById('identity').value.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
			if( identity.length < 1 )
			{
				alert( 'Please enter your OpenID identity Url.' );
				document.getElementById('identity').focus();
				return false;
			}

			return true;

		}

	/* ]]> */
	</script>

</asp:Content>
